<?php

/**
 * Movie form base class.
 *
 * @package    backstage
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseMovieForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'title'           => new sfWidgetFormTextarea(),
      'production_year' => new sfWidgetFormInput(),
      'duration'        => new sfWidgetFormInput(),
      'content'         => new sfWidgetFormTextarea(),
      'trailer'         => new sfWidgetFormTextarea(),
      'imdb'            => new sfWidgetFormTextarea(),
      'available'       => new sfWidgetFormInputCheckbox(),
      'rentable'        => new sfWidgetFormInputCheckbox(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorPropelChoice(array('model' => 'Movie', 'column' => 'id', 'required' => false)),
      'title'           => new sfValidatorString(),
      'production_year' => new sfValidatorInteger(array('required' => false)),
      'duration'        => new sfValidatorInteger(array('required' => false)),
      'content'         => new sfValidatorString(array('required' => false)),
      'trailer'         => new sfValidatorString(array('required' => false)),
      'imdb'            => new sfValidatorString(array('required' => false)),
      'available'       => new sfValidatorBoolean(),
      'rentable'        => new sfValidatorBoolean(),
      'created_at'      => new sfValidatorDateTime(array('required' => false)),
      'updated_at'      => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('movie[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Movie';
  }


}
